package com.inossem.warehousestorage_inossem.utils;

import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;

/**
 * Created by leij on 2017/7/20.
 */

public abstract class EditTextWatcher implements TextWatcher {

    EditText mEditText;

    public EditTextWatcher() {
    }

    public EditTextWatcher(EditText editText) {
        mEditText = editText;
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {

    }

    @Override
    public void afterTextChanged(Editable s) {
        String text = s.toString();
        onScan(text);
    }

    public abstract void onScan(String text);
}
